package io.practiceAll;

import java.io.*;

public class ObjectInputStreamAndOOS {
    public static void main(String[] args) throws IOException, ClassNotFoundException{
       /* FileOutputStream fileOutputStream = new FileOutputStream("stu.txt");
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
        objectOutputStream.writeObject(new Student("w",1,"nan",new String[]{"yjpyjp"}));
        objectOutputStream.close();*/
        FileInputStream fileInputStream = new FileInputStream("stu.txt");
        ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
        Object o = objectInputStream.readObject();
        Student o1 = (Student) o;
        System.out.println(o1);
        objectInputStream.close();



    }
}
